//package com.sohh.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
//import org.springframework.security.crypto.password.PasswordEncoder;
//
///**
// * @description: 基于配置类自定义配置类和密码
// * @author: ruoan
// * @date: 2021/2/5 15:17
// */
////@Configuration
//public class SecurityConfig extends WebSecurityConfigurerAdapter {
//
//    /**
//     *  spring security 需要 PasswordEncoder的实现类
//     * @return
//     */
//    @Bean
//    public PasswordEncoder passwordEncoder(){
//        return new BCryptPasswordEncoder();
//    }
//
//
//    /**
//     * 实现configure方法重写用户名和密码
//     * @param auth
//     * @throws Exception
//     */
//    @Override
//    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
//
//        String encode = "123";
//        encode= passwordEncoder().encode(encode);
//        auth.inMemoryAuthentication().withUser("ruoan").password(encode).roles("root");
//
//    }
//}
